//
// Copyright (C) 2011 - 2013  Steve Channell steve.channell@cepheis.com
//
// This file is part of Cephei.QL, an open-source library wrapper 
// arround QuantLib http://quantlib.org/
//
// Cephei.QL is open source software: you can redistribute it and/or modify it
// under the terms of the license.  You should have received a
// copy of the license along with this program; if not, please email
// <support@cepheis.com>. The license is also available online at
// <http://cepheis.com/license.htm>.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE.  See the license for more details.
//
// Version 2.2 with QuantLib 1.2.1
//#include "stdafx.h"
#include "Merton76Process.h"
using namespace Cephei::QL::Processes;
#include <gen/QL/Termstructures/Volatility/Equityfx/BlackVolTermStructure.h>
#include <gen/QL/Termstructures/YieldTermStructure.h>
#include <gen/QL/Quote.h>
#include <gen/QL/Math/Array.h>
#include <gen/QL/StochasticProcess1D.h>
using namespace Cephei::QL::Termstructures::Volatility::Equityfx;
using namespace Cephei::QL::Termstructures;
using namespace Cephei::QL;
using namespace Cephei::QL::Math;
#define HANDLE
#undef ABSTRACT
#undef STRUCT
Cephei::QL::Processes::CMerton76Process::CMerton76Process (Cephei::QL::IQuote^ stateVariable, Cephei::QL::Termstructures::IYieldTermStructure^ dividendTS, Cephei::QL::Termstructures::IYieldTermStructure^ riskFreeTS, Cephei::QL::Termstructures::Volatility::Equityfx::IBlackVolTermStructure^ blackVolTS, Cephei::QL::IQuote^ jumpInt, Cephei::QL::IQuote^ logJMean, Cephei::QL::IQuote^ logJVol) : CStochasticProcess1D(CMerton76Process::typeid)
{
    CQuote^ _CstateVariable;
    CYieldTermStructure^ _CdividendTS;
    CYieldTermStructure^ _CriskFreeTS;
    CBlackVolTermStructure^ _CblackVolTS;
    CQuote^ _CjumpInt;
    CQuote^ _ClogJMean;
    CQuote^ _ClogJVol;
    try
    {
#ifdef HANDLE
        _phMerton76Process = NULL;
#endif
        _CstateVariable = safe_cast<CQuote^> (stateVariable);
        _CstateVariable->Lock();
        Handle<QuantLib::Quote>& _stateVariable = static_cast<Handle<QuantLib::Quote>&> (_CstateVariable->GetHandle ()); 
        _CdividendTS = safe_cast<CYieldTermStructure^> (dividendTS);
        _CdividendTS->Lock();
        Handle<QuantLib::YieldTermStructure>& _dividendTS = static_cast<Handle<QuantLib::YieldTermStructure>&> (_CdividendTS->GetHandle ()); 
        _CriskFreeTS = safe_cast<CYieldTermStructure^> (riskFreeTS);
        _CriskFreeTS->Lock();
        Handle<QuantLib::YieldTermStructure>& _riskFreeTS = static_cast<Handle<QuantLib::YieldTermStructure>&> (_CriskFreeTS->GetHandle ()); 
        _CblackVolTS = safe_cast<CBlackVolTermStructure^> (blackVolTS);
        _CblackVolTS->Lock();
        Handle<QuantLib::BlackVolTermStructure>& _blackVolTS = static_cast<Handle<QuantLib::BlackVolTermStructure>&> (_CblackVolTS->GetHandle ()); 
        _CjumpInt = safe_cast<CQuote^> (jumpInt);
        _CjumpInt->Lock();
        Handle<QuantLib::Quote>& _jumpInt = static_cast<Handle<QuantLib::Quote>&> (_CjumpInt->GetHandle ()); 
        _ClogJMean = safe_cast<CQuote^> (logJMean);
        _ClogJMean->Lock();
        Handle<QuantLib::Quote>& _logJMean = static_cast<Handle<QuantLib::Quote>&> (_ClogJMean->GetHandle ()); 
        _ClogJVol = safe_cast<CQuote^> (logJVol);
        _ClogJVol->Lock();
        Handle<QuantLib::Quote>& _logJVol = static_cast<Handle<QuantLib::Quote>&> (_ClogJVol->GetHandle ()); 
        _ppMerton76Process = new boost::shared_ptr<QuantLib::Merton76Process> (new QuantLib::Merton76Process ( _stateVariable,  _dividendTS,  _riskFreeTS,  _blackVolTS,  _jumpInt,  _logJMean,  _logJVol ));
        SetStochasticProcess1D (boost::dynamic_pointer_cast<QuantLib::StochasticProcess1D> (*_ppMerton76Process));
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown std::exception"));
	}
    finally
    {
        if (_CstateVariable != nullptr) _CstateVariable->Unlock();
        if (_CdividendTS != nullptr) _CdividendTS->Unlock();
        if (_CriskFreeTS != nullptr) _CriskFreeTS->Unlock();
        if (_CblackVolTS != nullptr) _CblackVolTS->Unlock();
        if (_CjumpInt != nullptr) _CjumpInt->Unlock();
        if (_ClogJMean != nullptr) _ClogJMean->Unlock();
        if (_ClogJVol != nullptr) _ClogJVol->Unlock();
    }
}
Cephei::QL::Processes::CMerton76Process::CMerton76Process (boost::shared_ptr<QuantLib::Merton76Process>& childNative, Object^ owner) : CStochasticProcess1D(CMerton76Process::typeid)
{
#ifdef HANDLE
	_phMerton76Process = NULL;
#endif
	_ppMerton76Process = &childNative;
    _ppStochasticProcess1D = new boost::shared_ptr<QuantLib::StochasticProcess1D> (boost::dynamic_pointer_cast<QuantLib::StochasticProcess1D> (*_ppMerton76Process));
}
Cephei::QL::Processes::CMerton76Process::CMerton76Process (QuantLib::Merton76Process& childNative, Object^ owner) : CStochasticProcess1D(CMerton76Process::typeid)
{
#ifdef HANDLE
	_phMerton76Process = NULL;
#endif
	_ppMerton76Process = new boost::shared_ptr<QuantLib::Merton76Process> (&childNative);
    _ppStochasticProcess1D = new boost::shared_ptr<QuantLib::StochasticProcess1D> (boost::dynamic_pointer_cast<QuantLib::StochasticProcess1D> (*_ppMerton76Process));
    _Merton76ProcessOwner = owner;
    _StochasticProcess1DOwner = owner;
}

Cephei::QL::Processes::CMerton76Process::CMerton76Process (CMerton76Process^ copy) : CStochasticProcess1D(CMerton76Process::typeid)
{
#ifdef HANDLE
	_phMerton76Process = NULL;
#endif
	if (copy->HasNative() != NULL)
    {
		_ppMerton76Process = new boost::shared_ptr<QuantLib::Merton76Process> (copy->GetShared());
        _ppStochasticProcess1D = new boost::shared_ptr<QuantLib::StochasticProcess1D> (boost::dynamic_pointer_cast<QuantLib::StochasticProcess1D> (*_ppMerton76Process));
    }
}
Cephei::QL::Processes::CMerton76Process::CMerton76Process (PLATFORM::Type^ t) : CStochasticProcess1D(CMerton76Process::typeid)
{
#ifdef HANDLE
	_phMerton76Process = NULL;
#endif
	if (!t->IsSubclassOf(CMerton76Process::typeid))
		throw REFNEW Exception ("Invalid base-case init");
}
#ifdef HANDLE
Cephei::QL::Processes::CMerton76Process::CMerton76Process (QuantLib::Handle<QuantLib::Merton76Process>& childNative, Object^ owner)  : CStochasticProcess1D(CMerton76Process::typeid)
{
	_phMerton76Process = &childNative;
	_ppMerton76Process = &static_cast<boost::shared_ptr<QuantLib::Merton76Process>>(childNative.currentLink());
    _ppStochasticProcess1D = new boost::shared_ptr<QuantLib::StochasticProcess1D> (boost::dynamic_pointer_cast<QuantLib::StochasticProcess1D> (*_ppMerton76Process));
    _Merton76ProcessOwner = owner;
}
Cephei::QL::Processes::CMerton76Process::CMerton76Process (QuantLib::Handle<QuantLib::Merton76Process> childNative)  : CStochasticProcess1D(CMerton76Process::typeid)
{
	_phMerton76Process = &childNative;
	_ppMerton76Process = &static_cast<boost::shared_ptr<QuantLib::Merton76Process>>(childNative.currentLink());
    _ppStochasticProcess1D = new boost::shared_ptr<QuantLib::StochasticProcess1D> (boost::dynamic_pointer_cast<QuantLib::StochasticProcess1D> (*_ppMerton76Process));
}
#endif
#ifdef STRUCT
Cephei::QL::Processes::CMerton76Process::CMerton76Process (QuantLib::Merton76Process childNative)  : CStochasticProcess1D(CMerton76Process::typeid)
{
#ifdef HANDLE
	_phMerton76Process = NULL;
#endif
	_ppMerton76Process = new boost::shared_ptr<QuantLib::Merton76Process> (new QuantLib::Merton76Process (childNative));
    _ppStochasticProcess1D = new boost::shared_ptr<QuantLib::StochasticProcess1D> (boost::dynamic_pointer_cast<QuantLib::StochasticProcess1D> (*_ppMerton76Process));
}
#endif

Cephei::QL::Processes::CMerton76Process::~CMerton76Process ()
{
    if (_ppMerton76Process != NULL)
    {
	    delete _ppMerton76Process;
        _ppMerton76Process = NULL;
    }
}
Cephei::QL::Processes::CMerton76Process::!CMerton76Process ()
{
    if (_ppMerton76Process != NULL)
    {
	    delete _ppMerton76Process;
    }
}
QuantLib::Merton76Process& Cephei::QL::Processes::CMerton76Process::GetReference ()
{
    if (_ppMerton76Process == NULL) throw REFNEW NativeNullException ();
	return **_ppMerton76Process;
}
boost::shared_ptr<QuantLib::Merton76Process>& Cephei::QL::Processes::CMerton76Process::GetShared ()
{
    if (_ppMerton76Process == NULL) throw REFNEW NativeNullException ();
	return *_ppMerton76Process;
}
QuantLib::Merton76Process* Cephei::QL::Processes::CMerton76Process::GetPointer ()
{
    if (_ppMerton76Process == NULL) throw REFNEW NativeNullException ();
	return &**_ppMerton76Process;
}
#ifdef HANDLE
QuantLib::Handle<QuantLib::Merton76Process>& Cephei::QL::Processes::CMerton76Process::GetHandle ()
{
	if (_phMerton76Process == NULL)
	{
		_phMerton76Process = new Handle<QuantLib::Merton76Process> (*_ppMerton76Process);
	}
	return *_phMerton76Process;
}
#endif
bool Cephei::QL::Processes::CMerton76Process::HasNative () 
{
	return (_ppMerton76Process != NULL);
}

Double Cephei::QL::Processes::CMerton76Process::Apply (Double prm1, Double prm2)
{
    try
    {
        QuantLib::Real _prm1 = (QuantLib::Real)ValueHelper::Convert (prm1); //a
        QuantLib::Real _prm2 = (QuantLib::Real)ValueHelper::Convert (prm2); //a
    	QuantLib::Real _rv = (QuantLib::Real)(*_ppMerton76Process)->apply ( _prm1,  _prm2 );   
        Double _nrv = (Double)ValueHelper::Convert (_rv); //c
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Cephei::QL::Termstructures::Volatility::Equityfx::IBlackVolTermStructure^ Cephei::QL::Processes::CMerton76Process::BlackVolatility::get ()
{
    try
    {
    	Handle<QuantLib::BlackVolTermStructure>& _rv = (Handle<QuantLib::BlackVolTermStructure>&)(*_ppMerton76Process)->blackVolatility ( );   
        Cephei::QL::Termstructures::Volatility::Equityfx::CBlackVolTermStructure^ _nrv = REFNEW Cephei::QL::Termstructures::Volatility::Equityfx::CBlackVolTermStructure (_rv, this);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Double Cephei::QL::Processes::CMerton76Process::Diffusion (Double prm1, Double prm2)
{
    try
    {
        QuantLib::Time _prm1 = (QuantLib::Time)ValueHelper::Convert (prm1); //a
        QuantLib::Real _prm2 = (QuantLib::Real)ValueHelper::Convert (prm2); //a
    	QuantLib::Real _rv = (QuantLib::Real)(*_ppMerton76Process)->diffusion ( _prm1,  _prm2 );   
        Double _nrv = (Double)ValueHelper::Convert (_rv); //c
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Cephei::QL::Termstructures::IYieldTermStructure^ Cephei::QL::Processes::CMerton76Process::DividendYield::get ()
{
    try
    {
    	Handle<QuantLib::YieldTermStructure>& _rv = (Handle<QuantLib::YieldTermStructure>&)(*_ppMerton76Process)->dividendYield ( );   
        Cephei::QL::Termstructures::CYieldTermStructure^ _nrv = REFNEW Cephei::QL::Termstructures::CYieldTermStructure (_rv, this);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Double Cephei::QL::Processes::CMerton76Process::Drift (Double prm1, Double prm2)
{
    try
    {
        QuantLib::Time _prm1 = (QuantLib::Time)ValueHelper::Convert (prm1); //a
        QuantLib::Real _prm2 = (QuantLib::Real)ValueHelper::Convert (prm2); //a
    	QuantLib::Real _rv = (QuantLib::Real)(*_ppMerton76Process)->drift ( _prm1,  _prm2 );   
        Double _nrv = (Double)ValueHelper::Convert (_rv); //c
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Cephei::QL::IQuote^ Cephei::QL::Processes::CMerton76Process::JumpIntensity::get ()
{
    try
    {
    	Handle<QuantLib::Quote>& _rv = (Handle<QuantLib::Quote>&)(*_ppMerton76Process)->jumpIntensity ( );   
        Cephei::QL::CQuote^ _nrv = REFNEW Cephei::QL::CQuote (_rv, this);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Cephei::QL::IQuote^ Cephei::QL::Processes::CMerton76Process::LogJumpVolatility::get ()
{
    try
    {
    	Handle<QuantLib::Quote>& _rv = (Handle<QuantLib::Quote>&)(*_ppMerton76Process)->logJumpVolatility ( );   
        Cephei::QL::CQuote^ _nrv = REFNEW Cephei::QL::CQuote (_rv, this);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Cephei::QL::IQuote^ Cephei::QL::Processes::CMerton76Process::LogMeanJump::get ()
{
    try
    {
    	Handle<QuantLib::Quote>& _rv = (Handle<QuantLib::Quote>&)(*_ppMerton76Process)->logMeanJump ( );   
        Cephei::QL::CQuote^ _nrv = REFNEW Cephei::QL::CQuote (_rv, this);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Cephei::QL::Termstructures::IYieldTermStructure^ Cephei::QL::Processes::CMerton76Process::RiskFreeRate::get ()
{
    try
    {
    	Handle<QuantLib::YieldTermStructure>& _rv = (Handle<QuantLib::YieldTermStructure>&)(*_ppMerton76Process)->riskFreeRate ( );   
        Cephei::QL::Termstructures::CYieldTermStructure^ _nrv = REFNEW Cephei::QL::Termstructures::CYieldTermStructure (_rv, this);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Cephei::QL::IQuote^ Cephei::QL::Processes::CMerton76Process::StateVariable::get ()
{
    try
    {
    	Handle<QuantLib::Quote>& _rv = (Handle<QuantLib::Quote>&)(*_ppMerton76Process)->stateVariable ( );   
        Cephei::QL::CQuote^ _nrv = REFNEW Cephei::QL::CQuote (_rv, this);
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Double Cephei::QL::Processes::CMerton76Process::Time (DateTime d)
{
    try
    {
        QuantLib::Date _d = (QuantLib::Date)ValueHelper::Convert (d); //a
    	QuantLib::Time _rv = (QuantLib::Time)(*_ppMerton76Process)->time ( _d );   
        Double _nrv = (Double)ValueHelper::Convert (_rv); //c
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown std::exception"));
	}
    finally
    {
    }
}
Double Cephei::QL::Processes::CMerton76Process::X0::get ()
{
    try
    {
    	QuantLib::Real _rv = (QuantLib::Real)(*_ppMerton76Process)->x0 ( );   
        Double _nrv = (Double)ValueHelper::Convert (_rv); //c
    	return _nrv;
	}
    catch (QuantLib::Error& _error)
    {
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown quantlib error"));
        
    }
	catch (std::exception& _error)
	{
        if (_error.what())
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String(_error.what()));
        else
		    throw REFNEW NativeExcpetion (REFNEW PLATFORM::String("Unknown std::exception"));
	}
    finally
    {
    }
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Factory class

Cephei::QL::Processes::IMerton76Process^ Cephei::QL::Processes::CMerton76Process_Factory::Create (Cephei::QL::IQuote^ stateVariable, Cephei::QL::Termstructures::IYieldTermStructure^ dividendTS, Cephei::QL::Termstructures::IYieldTermStructure^ riskFreeTS, Cephei::QL::Termstructures::Volatility::Equityfx::IBlackVolTermStructure^ blackVolTS, Cephei::QL::IQuote^ jumpInt, Cephei::QL::IQuote^ logJMean, Cephei::QL::IQuote^ logJVol)
{
    return REFNEW CMerton76Process ( stateVariable,  dividendTS,  riskFreeTS,  blackVolTS,  jumpInt,  logJMean,  logJVol);
}
